Working with the Viewer > Integrating with Your Application > Configuring Samples > How to Configure PHP Samples |
The Prizm Content Connect PHP Sample requires PHP version 5.4 and above.
Copy Code
|
|
---|---|
Alias /pccis_sample /usr/share/prizm/Samples/php <Directory /usr/share/prizm/Samples/php> AllowOverride All </Directory> |
Example |
Copy Code
|
---|---|
apache2ctl configtest |
Example |
Copy Code
|
---|---|
apache2ctl restart |
By default, the PHP sample is installed to: C:\Prizm\Samples\php, assuming use of the default Prizm Content Connect location of C:\Prizm.
Install IIS, along with the CGI component, and then install and configure PHP. The instructions and installer provided on the IIS site are now old and outdated, as they install PHP version 5.3. Instead, install the latest version of PHP using the Web Platform Installer. If using an already configured server, make sure you are using PHP version 5.4 or higher.
To configure the sample:
Now you can browse to http://localhost/pccis_sample/splash in your browser to see the PHP sample.
Install Apache, or an Apache stack like XAMPP or WAMP server, and a supported version of PHP.
To configure the sample:
Example Copy Code # PCC PHP sample alias Alias /pccis_sample "C:/Prizm/Samples/php" <Directory "C:/Prizm/Samples/php"> Allow from all Require all granted </Directory>
Now you can browse to http://localhost/pccis_sample/splash in your browser to see the PHP sample.
By default, PHP has a small file size upload. If you need to be able to upload larger files through the splash page, you may need to change the following values in the php.ini file of your PHP installation:
Example |
Copy Code
|
---|---|
upload_max_filesize = 1000M post_max_size = 1000M |
This sets the file upload to 1GB, which should be enough to test most files through the splash page. These settings may be too high for a production service, so adjust those accordingly when deploying to production.
From the splash page you have two options:
The PHP Sample folder contains 3 sub-folders, one folder for each of the two samples (book-reader-sample and full-viewer-sample) and one folder for the splash page:
Each of the sample folders are completely self-contained, meaning that they contain all of the files needed to run the sample. Furthermore, with the exception of a few project files and build files, the sample folders contain only the files needed to run the sample.
File / Folder |
Description |
viewer-assets folder |
Contains the essential JavaScript, CSS, fonts, images, language data, and templates (HTML) that make up the viewer. |
viewer-assets/less folder |
Contains less that can be used to build the viewer CSS. This folder is non-essential, and does not need to be re-distributed. |
viewer-assets/Gruntfile.js |
Contains Grunt tasks to build the viewer less. This file is non-essential and does not need to be re-distributed. |
viewer-assets/package.json |
A file used by npm (a package manager). It defines the dependencies installed by npm, which are required to run Grunt and compile the less. |
viewer-webtier folder |
Contains files that implement the php layer of communication between the client-side viewer and the PCC backend services. |
viewer-webtier/pcc.php |
Contains the supporting functions for the RESTful communication between the viewer and web server. The client side viewer Javascript object will use this RESTful interface as described in PCC RESTful API. The file is required for functionality in a PHP enabled web server environment. While the code for the functions can be modified as needed, modifications should be done with care. Most of the current web server RESTful interface passes the request onto Prizm Services. |
viewer-webtier/pcc.config |
Defines the configuration for the web tier. Configuration parameters include: Path to source documents, path to saved markup files, path to image stamp files, and connection settings for the PCC RESTful API. |
viewer-webtier/imagingServiceProxy.php |
This class provides a common set of methods for communicating with the PCC Imaging Service. |
viewer-webtier/pccConfig.php |
This class parses the pcc.config file and provides methods for easily reading its parameters. |
viewer-webtier/utils.php |
A class containing helpful methods used frequently throughout the application. |
index.php |
The default web starting page in this sample. The HTML5 viewer’s code gets loaded by this page. |
.htaccess |
Contains Apache web server settings. |
predefinedSearch.json |
This data file contains information defining search queries that will appear as selectable items in the full viewer. Note: This file is consumed by the page Default.aspx and the JSON is injected into the HTML that is returned by Default.aspx. Ultimately, the predefined search terms are provided as a JavaScript hash, when the viewer is created. |
redactionReason.json |
This data file contains information defining redaction reasons that are available in the viewer. Note: This file is consumed by the page Default.aspx and the JSON is injected into the HTML that is returned by Default.aspx. Ultimately, the redaction reasons are provided as a JavaScript hash, when the viewer is created. |
File / Folder |
Description |
viewer-assets folder |
Contains the essential JavaScript, CSS, fonts, images, language data, and templates (HTML) that make up the book reader viewer. |
viewer-assets/less folder |
Contains less that can be used to build the viewer CSS. This folder is non-essential, and does not need to be re-distributed. |
viewer-assets/Gruntfile.js |
Contains Grunt tasks to build the viewer less. This file is non-essential and does not need to be re-distributed. |
viewer-assets/package.json |
A file used by npm (a package manager). It defines the dependencies installed by npm, which are required to run Grunt and compile the less. |
viewer-assets/selection.json |
A file used by the IcoMoon application to generate the icons in the book reader viewer. If you need to add an icon to the viewer, you can add the icon to this file and use the IcoMoon application (https://icomoon.io) to generate a new icon font. This file is non-essential and does not need to be re-distributed. |
viewer-webtier folder |
Contains files that implement the php layer of communication between the client-side book reader viewer and the PCC backend services. |
viewer-webtier/createSession.php |
This file is used by index.html to create a PCC Viewing Session with the PCC RESTful API. |
viewer-webtier/pcc.php |
Contains the supporting functions for the RESTful communication between the book reader viewer and web server. The client side viewer Javascript object will use this RESTful interface as described in PCC RESTful API. The file is required for functionality in a PHP enabled web server environment. While the code for the functions can be modified as needed, modifications should be done with care. Most of the current web server RESTful interface passes the request onto Prizm Services. |
viewer-webtier/pcc.config |
Defines the configuration for the web tier. Configuration parameters include: Path to source documents, path to saved markup files, path to image stamp files, and connection settings for the PCC RESTful API. |
viewer-webtier/imagingServiceProxy.php |
This class provides a common set of methods for communicating with the PCC Imaging Service. |
viewer-webtier/pccConfig.php |
This class parses the pcc.config file and provides methods for easily reading its parameters. |
viewer-webtier/utils.php |
A class containing helpful methods used frequently throughout the application. |
index.html |
The default page for the sample. This page calls the createSession.php service to start a viewing session with the PCC RESTful services and then the page loads the book reader. |
sample-config.js |
Contains references to the assets, web tier, and language files used by the viewer in this sample. |
.htaccess |
Contains Apache web server settings. |
The file pcc.config is used to configure the resources and storage used by the viewer web tier. This file can be found in each sample folder at: <sample-folder-name>/viewer-webtier/pcc.config. This file is self-documenting, but a little information about the configuration options is given below:
<DocumentPath> |
The sample pulls named documents from this location. The DocumentPath must have read/write permissions in order for the file drag and drop functionality of the splash page to work. |
<ImageStampPath> |
The sample pulls image stamps from this location. Any valid image stamp in this folder will be available to the viewer for use as an image stamp. The ImageStampPath must have read permissions. |
<ValidImageStampTypes> |
A comma separated value list of file extensions. These extensions specify the valid image stamp file types. Only images in the ImageStampPath with a valid file type will be available for use as an image stamp in the viewer. |
<MarkupsPath> |
Saved markup XML is kept in this folder. The MarkupsPath will be written to by the web server process, so it must have read/write permissions. |
<WebService[Scheme|Host|Port|Path|V2Path]> |
Specifies how to connect with the PCC RESTful API. |